<div class="span9 crud">
    <h2><?php echo ( $this->create ? 'Chuyên mục mới' : 'Cập nhật chuyên mục' )?> </h2>
        <form action="<?php echo URL_BASE?>/admin/category/<?php echo ( $this->create ? 'postCreate' : 'postEdit' )?>" method="POST" class="form-horizontal">                    
    <input type="hidden" name="catId" value="<?php echo ( $this->create ? '' : $this->categories->getId() )?>" />
    <fieldset><legend>Cập nhật thông tin chuyên mục</legend>
       
    <div class="control-group">         
        <label class="control-label" for="name">Tên chuyên mục</label>              
        <div class="controls">
            <input type="text" id="name" name="name" value="<?php echo ( $this->create ? '' : $this->categories->getName() ); ?>" placeholder="Category Name...">
        </div>
    </div>
        <br>
    <div class="control-group">
        <label class="control-label" for="parentId">Thành phần của chuyên mục:</label>             
        <div class="controls">         
            <select name="parentId" id="parentId">
                <option value="0">Nhóm mới</option>
                <?php
                    foreach($this->parents as $key =>$parent){
                        if((!isset($this->categories)||($this->categories->getId()!=$parent->getId()))){
                ?>                 
                <option value="<?php echo $parent->getId() ?>"
                <?php if($this->id === $parent->getId()){
                    echo 'selected';
                }?>
                ><?php echo $parent->getName() ?></option>
                <?php
                    }
                    }
                ?>                
            </select>             
        </div>
    </div>

        <div class="form-actions"><br>
        <input type="submit" value="Cập nhật" class="btn btn-primary">
        </fieldset>
    <a href="<?php echo URL_BASE?>/admin/category" class="btn">Quay lại</a>
    </div>
       </form>   
</div>